package com.nstar.model.orderexpress;

import java.io.Serializable;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="rest_info"
 *     
*/
public class RestInfo implements Serializable {

    /** identifier field */
    private String restId;

    /** persistent field */
    private String name;

    /** nullable persistent field */
    private String spellAb;

    /** nullable persistent field */
    private String addr;

    /** persistent field */
    private String telephone;

    /** nullable persistent field */
    private String http;

    /** nullable persistent field */
    private String email;

    /** nullable persistent field */
    private String remarks;

    /** persistent field */
    private com.nstar.model.orderexpress.UserType userType;

    /** persistent field */
    private com.nstar.model.orderexpress.UserLevel userLevel;

    /** persistent field */
    private com.nstar.model.orderexpress.Area area;

    /** persistent field */
    private Set menu2Rests;

    /** full constructor */
    public RestInfo(String restId, String name, String spellAb, String addr, String telephone, String http, String email, String remarks, com.nstar.model.orderexpress.UserType userType, com.nstar.model.orderexpress.UserLevel userLevel, com.nstar.model.orderexpress.Area area, Set menu2Rests) {
        this.restId = restId;
        this.name = name;
        this.spellAb = spellAb;
        this.addr = addr;
        this.telephone = telephone;
        this.http = http;
        this.email = email;
        this.remarks = remarks;
        this.userType = userType;
        this.userLevel = userLevel;
        this.area = area;
        this.menu2Rests = menu2Rests;
    }

    /** default constructor */
    public RestInfo() {
    }

    /** minimal constructor */
    public RestInfo(String restId, String name, String telephone, com.nstar.model.orderexpress.UserType userType, com.nstar.model.orderexpress.UserLevel userLevel, com.nstar.model.orderexpress.Area area, Set menu2Rests) {
        this.restId = restId;
        this.name = name;
        this.telephone = telephone;
        this.userType = userType;
        this.userLevel = userLevel;
        this.area = area;
        this.menu2Rests = menu2Rests;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.String"
     *             column="REST_ID"
     *         
     */
    public String getRestId() {
        return this.restId;
    }

    public void setRestId(String restId) {
        this.restId = restId;
    }

    /** 
     *            @hibernate.property
     *             column="NAME"
     *             length="80"
     *             not-null="true"
     *         
     */
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /** 
     *            @hibernate.property
     *             column="SPELL_AB"
     *             length="30"
     *         
     */
    public String getSpellAb() {
        return this.spellAb;
    }

    public void setSpellAb(String spellAb) {
        this.spellAb = spellAb;
    }

    /** 
     *            @hibernate.property
     *             column="ADDR"
     *             length="200"
     *         
     */
    public String getAddr() {
        return this.addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    /** 
     *            @hibernate.property
     *             column="TELEPHONE"
     *             length="30"
     *             not-null="true"
     *         
     */
    public String getTelephone() {
        return this.telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    /** 
     *            @hibernate.property
     *             column="HTTP"
     *             length="100"
     *         
     */
    public String getHttp() {
        return this.http;
    }

    public void setHttp(String http) {
        this.http = http;
    }

    /** 
     *            @hibernate.property
     *             column="EMAIL"
     *             length="30"
     *         
     */
    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    /** 
     *            @hibernate.property
     *             column="REMARKS"
     *             length="200"
     *         
     */
    public String getRemarks() {
        return this.remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="USER_TYPE_ID"         
     *         
     */
    public com.nstar.model.orderexpress.UserType getUserType() {
        return this.userType;
    }

    public void setUserType(com.nstar.model.orderexpress.UserType userType) {
        this.userType = userType;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="LEVEL_ID"         
     *         
     */
    public com.nstar.model.orderexpress.UserLevel getUserLevel() {
        return this.userLevel;
    }

    public void setUserLevel(com.nstar.model.orderexpress.UserLevel userLevel) {
        this.userLevel = userLevel;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="AREA_ID"         
     *         
     */
    public com.nstar.model.orderexpress.Area getArea() {
        return this.area;
    }

    public void setArea(com.nstar.model.orderexpress.Area area) {
        this.area = area;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="REST_ID"
     *            @hibernate.collection-one-to-many
     *             class="com.nstar.model.orderexpress.Menu2Rest"
     *         
     */
    public Set getMenu2Rests() {
        return this.menu2Rests;
    }

    public void setMenu2Rests(Set menu2Rests) {
        this.menu2Rests = menu2Rests;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("restId", getRestId())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof RestInfo) ) return false;
        RestInfo castOther = (RestInfo) other;
        return new EqualsBuilder()
            .append(this.getRestId(), castOther.getRestId())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getRestId())
            .toHashCode();
    }

}
